﻿using CommunityToolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 畜牧业审核程序国产.Models.RagModel
{
    internal class MessageShowInChatItem:ObservableObject
    {
        private string _chatModel;
        private string _sender;
        private string _timestamp;
        private string _content;
        private bool _isSelected;
        private string _sessionId;
        //private ObservableCollection<KeyValuePair<string,string>> _docReferences;
        private string _docReferences;
        //private bool _isUserMessage;
        //private string _horizontalAlignment;

        public string ChatModel
        {
            get => _chatModel;
            set=> SetProperty(ref _chatModel, value);
        }
        public string Sender
        {
            get => _sender;
            set => SetProperty(ref _sender, value);
        }

        public string Timestamp
        {
            get => _timestamp;
            set => SetProperty(ref _timestamp, value);
        }

        public string Content
        {
            get => _content;
            set => SetProperty(ref _content, value);
        }

        public bool IsSelected
        {
            get => _isSelected;
            set => SetProperty(ref _isSelected, value);

        }

        public string SessionId
        {

            get => _sessionId;
            set=> SetProperty(ref _sessionId, value);
        }
        //public ObservableCollection<KeyValuePair<string,string>> DocReferences
        //{
        //    get => _docReferences;
        //    set=> SetProperty(ref _docReferences, value);
        //}
        public string DocReferences
        {
            get => _docReferences;
            set=>SetProperty(ref _docReferences, value);
        }
        //public bool IsUserMessage
        //{
        //    get => _isUserMessage;
        //    set => SetProperty(ref _isUserMessage, value);
        //}
        //public string HorizontalAlignment
        //{
        //    get => _horizontalAlignment;
        //    set=>SetProperty(ref _horizontalAlignment, value);
        //}

        // 可选：提供一个构造函数来初始化属性
        public MessageShowInChatItem(string chatModel, string sender, string timestamp, string content)//, string horizontalAlignment,bool isUserMessage)
        {
            ChatModel = chatModel;
            Sender = sender;
            Timestamp = timestamp;
            Content = content;
            //IsUserMessage = isUserMessage;
            //HorizontalAlignment = horizontalAlignment;
        }
        public MessageShowInChatItem()//如果没有这个的话,参数不为4或者6就会报错
        {

        }

        public MessageShowInChatItem(string chatModel, string sender, string timestamp, string content,bool isSelected,string _sessionId,string docReferences)//,Dictionary<string,string> docReference)
        {
            ChatModel = chatModel;
            Sender = sender;
            Timestamp = timestamp;
            Content = content;
            IsSelected = isSelected;
            SessionId = _sessionId;
            //foreach (var item in docReference)
            //{
            //    DocReferences.Add(new KeyValuePair<string, string>(  item.Key, item.Value ));
            //}
            this.DocReferences = docReferences;
        }
    }
}
